package com.trickytriads.actions
{
	import com.trickytriads.events.LoadNewsEvent;
	import com.trickytriads.services.interfaces.I_NewsService;
	
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	/**
	 * Controller for loading the Tricky Triad news section.
	 **/
	public class LoadNewsAction extends EventDispatcher
	{
		// Inject the specified NewsService
		[Inject]
		public var newsService:I_NewsService;
		
		public function LoadNewsAction(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		[MessageHandler(selector="newsLoadRequest")]
		public function requestNewsItem(evt:LoadNewsEvent) : void
		{
			trace("Received news load request for item " + evt.newsid.toString());
			newsService.loadNewsItem(evt.newsid);
		}
		
	}
}